<template>
  <div class="">
    <div
      v-draggable
      class="draggable"
      @click="emits('click')"
      :style="{
        width:
          typeof props.width === 'number' ? props.width + 'px' : props.width,
        height:
          typeof props.width === 'number' ? props.width + 'px' : props.width,
        backgroundColor: props.backgroundColor,
        color: props.color,
      }"
    >
      设置
    </div>
  </div>
</template>

<script setup lang="ts">
  const props = defineProps({
    width: {
      type: [String, String],
      default: "60px",
    },
    backgroundColor: {
      type: String,
      default: "#fff",
    },
    color: {
      type: String,
      default: "#333",
    },
    label: {
      type: String,
      default: '设置'
    }
  });
  const emits = defineEmits(["click"]);
</script>

<style lang="scss" scoped>
  .draggable {
    position: fixed;
    top: calc(50vh - 20px);
    left: calc(100vw - 20px);
    transform: translate(-100%, -100%);
    padding: 5px;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.12);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
</style>
